package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;


@TableName("t_shopCart")
public class ShopCartBean {
    /**购物车id*/
    @TableId(value = "pk_shopCartId",type = IdType.AUTO)
    private int id;
    /**产品对象*/
    @TableField(exist = false)
    private ProductBean product;
    /**产品编号*/
    @TableField("fk_productId")
    private int productId;
    /**用户id*/
    @TableField("fk_userId")
    private Integer userId;
    /**购物车的购买数量*/
    @TableField("s_count")
    private int count = 1;


    public ShopCartBean() {
    }

    public ShopCartBean(Integer userId,int productId) {
        this.productId = productId;
        this.userId = userId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "ShopCartBean{" +
                "id=" + id +
                ", product=" + product +
                ", userId=" + userId +
                ", count=" + count +
                "}\n";
    }
}
